---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.6.log
  log type:  text
 opened on:  12 May 2025, 18:28:07

. use "C:\Users\sbstjp\OneDrive - Cardiff University\UKPVS.dta" // Prosser, Magasin, Proulx and Haddock, UK Pro
> gressive Values Dataset, September 2024 // Accessed on March 20 2025

. 
. // Create a weight
. gen weight = 1

. 
. * Code age into categories - the other variables are already in such categories
. recode ageNew (min/24=1 "0-24") (25/34=2 "25-34") (35/44=3 "35-44") (45/54=4 "45-54") (55/max=5 "55+"), gener
> ate(age_group)
(616 differences between ageNew and age_group)

. 
. * Generate totals for the weights - these are based on BESW29 as this dataset has political selfid, unlike ce
> nsus data
. replace gender=. if inrange(gender, 3, 5)
(11 real changes made, 11 to missing)

. rename gender FemaleGender

. gen sextot=.
(617 missing values generated)

. replace sextot = 0.50 if FemaleGender == 1 // Male
(241 real changes made)

. replace sextot = 0.50 if FemaleGender == 2 // Female
(365 real changes made)

. 
. gen agetot=.
(617 missing values generated)

. replace agetot = 0.13 if age_group == 1 //18-24
(134 real changes made)

. replace agetot = 0.14 if age_group == 2 //25-34
(193 real changes made)

. replace agetot = 0.19 if age_group == 3 //35-44
(139 real changes made)

. replace agetot = 0.19 if age_group == 4 //45-54
(92 real changes made)

. replace agetot = 0.35 if age_group == 5 //55+
(58 real changes made)

. 
. gen ethtot=.
(617 missing values generated)

. replace ethtot = 0.86 if Ethnicity2 == 1 // White
(200 real changes made)

. replace ethtot = 0.06 if Ethnicity2 == 2 // Asian
(148 real changes made)

. replace ethtot = 0.04 if Ethnicity2 == 3 // Black
(131 real changes made)

. replace ethtot = 0.04 if Ethnicity2 == 4 // Mixed
(117 real changes made)

. 
. gen edcats=.
(617 missing values generated)

. replace edcats=1 if inrange(Education, 1, 15) // Unidiplomaandbelow
(212 real changes made)

. replace edcats=2 if Education==16 // Undergraddegree
(241 real changes made)

. replace edcats=3 if inrange(Education, 17, 18) // Postgradandabove
(164 real changes made)

. 
. gen edtot=.
(617 missing values generated)

. replace edtot = 0.4740 if edcats == 1 // Unidiplomaandbelow
(212 real changes made)

. replace edtot = 0.2969 if edcats == 2 // Undergraddegree
(241 real changes made)

. replace edtot = 0.2291 if edcats == 3 // Postgradandabove
(164 real changes made)

. 
. gen inccats=.
(617 missing values generated)

. replace inccats=1 if inrange(Household_Income, 1, 6) //under 30k
(155 real changes made)

. replace inccats=2 if inrange(Household_Income, 7, 11) //30-60k
(168 real changes made)

. replace inccats=3 if inlist(Household_Income, 12, 13) //60-100k
(173 real changes made)

. replace inccats=4 if inlist(Household_Income, 14, 15) //over 100k
(106 real changes made)

. 
. gen inctot=.
(617 missing values generated)

. replace inctot = 0.3806 if inccats == 1 //under 30k
(155 real changes made)

. replace inctot = 0.3524 if inccats == 2 //30-60k
(168 real changes made)

. replace inctot = 0.1922 if inccats == 3 //60-100k
(173 real changes made)

. replace inctot = 0.0747 if inccats == 4 //over 100k
(106 real changes made)

. 
. * Rake the weights using the Stata survwgt package
. survwgt rake weight , by(FemaleGender age_group Ethnicity2 edcats inccats) totvars(sextot agetot ethtot edtot
>  inctot) generate(rakedweight)

. 
. // Create populism scale
. *Standardize items in the scale from 1-2, so scale is same as others in the book
. foreach var in Populism_1 Populism_2 Populism_3 Populism_4 Populism_5 Populism_6 {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  Populism_1 |        616    4.066558    .9037151          1          5
(1 missing value generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  Populism_2 |        616    3.413961    1.148658          1          5
(1 missing value generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  Populism_3 |        616    3.477273    1.086264          1          5
(1 missing value generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  Populism_4 |        616    4.206169    .8933508          1          5
(1 missing value generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  Populism_5 |        616    3.275974     1.14415          1          5
(1 missing value generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  Populism_6 |        616    3.862013    1.024315          1          5
(1 missing value generated)

. 
. * Add the responses directly
. gen Populism = (sPopulism_1 + sPopulism_2 + sPopulism_3 + sPopulism_4 + sPopulism_5 + sPopulism_6) / 6
(1 missing value generated)

. 
. // Standardize dependent variable from 1-2, so it's like others in book
. rename StrongLeader strongleader

. foreach var in strongleader {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
strongleader |        596    1.973154    1.070279          1          5
(21 missing values generated)

. rename sstrongleader StrongLeader

. 
. // Demographics
. *Delete missing values
. replace Household_Income=. if Household_Income==999
(15 real changes made, 15 to missing)

. 
. *Create dummies
. gen Graduate=. 
(617 missing values generated)

. replace Graduate=0 if inrange(Education, 1, 15)
(212 real changes made)

. replace Graduate=1 if inrange(Education, 16, 18)
(405 real changes made)

. 
. gen MinorityEthnic=. 
(617 missing values generated)

. replace MinorityEthnic=0 if Ethnicity2==1
(200 real changes made)

. replace MinorityEthnic=1 if inrange(Ethnicity2, 2, 5)
(417 real changes made)

. 
. // Standardize variables
. egen Age = std(ageNew)
(1 missing value generated)

. egen Income = std(Household_Income)
(15 missing values generated)

. rename PVS pvs1

. egen PVS = std(pvs1)

. 
. // Regressions
. regress Populism PVS [pweight= rakedweight], robust
(sum of wgt is .9997999542269523)

Linear regression                               Number of obs     =        569
                                                F(1, 567)         =       1.24
                                                Prob > F          =     0.2658
                                                R-squared         =     0.0075
                                                Root MSE          =     .19799

------------------------------------------------------------------------------
             |               Robust
    Populism | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         PVS |   .0180039   .0161629     1.11   0.266    -.0137426    .0497505
       _cons |   1.646559   .0170437    96.61   0.000     1.613083    1.680036
------------------------------------------------------------------------------

. eststo 
(est1 stored)

. regress Populism Age FemaleGender Graduate Income MinorityEthnic PVS [pweight= rakedweight], robust
(sum of wgt is .9997999542269523)

Linear regression                               Number of obs     =        569
                                                F(6, 562)         =      14.10
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2578
                                                Root MSE          =     .17198

--------------------------------------------------------------------------------
               |               Robust
      Populism | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
           Age |    -.04946   .0118661    -4.17   0.000    -.0727673   -.0261527
  FemaleGender |    .048788    .025532     1.91   0.057    -.0013618    .0989377
      Graduate |   -.141637   .0272345    -5.20   0.000    -.1951308   -.0881431
        Income |  -.0203681    .013643    -1.49   0.136    -.0471656    .0064295
MinorityEthnic |   .0263612   .0190937     1.38   0.168    -.0111425    .0638649
           PVS |   .0091867   .0136717     0.67   0.502    -.0176671    .0360406
         _cons |   1.671297   .0442622    37.76   0.000     1.584358    1.758237
--------------------------------------------------------------------------------

. eststo 
(est2 stored)

. regress StrongLeader PVS [pweight= rakedweight], robust
(sum of wgt is .9811560169710544)

Linear regression                               Number of obs     =        554
                                                F(1, 552)         =       0.36
                                                Prob > F          =     0.5503
                                                R-squared         =     0.0013
                                                Root MSE          =     .25518

------------------------------------------------------------------------------
             |               Robust
StrongLeader | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         PVS |  -.0096009   .0160647    -0.60   0.550    -.0411563    .0219546
       _cons |   1.196753   .0186395    64.21   0.000      1.16014    1.233366
------------------------------------------------------------------------------

. eststo 
(est3 stored)

. regress StrongLeader Age FemaleGender Graduate Income MinorityEthnic PVS [pweight= rakedweight], robust
(sum of wgt is .9811560169710544)

Linear regression                               Number of obs     =        554
                                                F(6, 547)         =       8.79
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1190
                                                Root MSE          =     .24076

--------------------------------------------------------------------------------
               |               Robust
  StrongLeader | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
           Age |  -.0221995   .0135784    -1.63   0.103    -.0488717    .0044726
  FemaleGender |   .0800304    .033763     2.37   0.018     .0137095    .1463514
      Graduate |  -.1234189   .0341033    -3.62   0.000    -.1904083   -.0564295
        Income |   .0432598   .0147896     2.93   0.004     .0142085    .0723111
MinorityEthnic |   .0822307    .029049     2.83   0.005     .0251695     .139292
           PVS |  -.0194477   .0139912    -1.39   0.165    -.0469307    .0080354
         _cons |   1.161751   .0602567    19.28   0.000     1.043388    1.280114
--------------------------------------------------------------------------------

. eststo 
(est4 stored)

. esttab

----------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)   
                 Populism        Populism    StrongLeader    StrongLeader   
----------------------------------------------------------------------------
PVS                0.0180         0.00919        -0.00960         -0.0194   
                   (1.11)          (0.67)         (-0.60)         (-1.39)   

Age                               -0.0495***                      -0.0222   
                                  (-4.17)                         (-1.63)   

FemaleGender                       0.0488                          0.0800*  
                                   (1.91)                          (2.37)   

Graduate                           -0.142***                       -0.123***
                                  (-5.20)                         (-3.62)   

Income                            -0.0204                          0.0433** 
                                  (-1.49)                          (2.93)   

MinorityEt~c                       0.0264                          0.0822** 
                                   (1.38)                          (2.83)   

_cons               1.647***        1.671***        1.197***        1.162***
                  (96.61)         (37.76)         (64.21)         (19.28)   
----------------------------------------------------------------------------
N                     569             569             554             554   
----------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.6.log
  log type:  text
 closed on:  12 May 2025, 18:28:17
---------------------------------------------------------------------------------------------------------------
